With regard to computers, garbage collection refers to a process of identifying unused areas of main memory storage. In accordance with an object oriented computing language such as Java, the computer executing the program allocates memory for each of the objects. A Java Virtual Machine (JVM) using Java allocates memory for the instantiation of the objects from a free memory area called a heap. Memory is allocated to, and freed from, the heap in blocks of one of a number of predetermined sizes. Eventually, when the objects are no longer being referenced by the program, the memory allocated for the created objects is reclaimed through a garbage collection process. The garbage collection process clears the objects from memory whereby the once allocated memory is again available for use. More particularly, a garbage collection process involves automatically determining which blocks of memory can be freed, marking unused blocks as no longer needed by an application, collecting all of the unused blocks of memory at periodic intervals, returning the unused blocks to the heap and marking the blocks as free for use. Such a garbage collection process is often referred to as a mark-and-sweep since unused portions of memory are marked as garbage during a mark phase and then removed from allocated memory in a sweep phase. Although the process of garbage collection frees memory it may be problematic in applications where its unpredictable consumption of processor time affects the running of the application.
The exact garbage collection strategy used by an object oriented program will often vary depending on the type of system in which the program is executing. For example, in some implementations, the garbage collector is a built-in component. In other applications, different garbage collectors may be plugged in for different circumstances. Many different algorithms have been employed in these different garbage collector implementations. For example, server applications in a multi-user multiprocessor environment tend to have a memory-use profile that differs from a uni-processor desktop computer environment. Furthermore, embedded-Java devices such as cell phones and handheld devices have different memory-use profiles. A single garbage collector is typically designed to implement one particular strategy and cannot be modified “on-the-fly” to change its strategy. Therefore, a customized garbage collector must typically be built into each programming instance depending upon the computer platform and operating environment in which the program is executing. On any given day, a particular set of garbage collection characteristics or garbage collection algorithm metrics will be better for one device but not for another device. For example, a device with a small amount of memory may require a very aggressive garbage collection routine whereas as a large server with lots of memory may permit a more relaxed approach. In each case, a different type of garbage collection algorithm is needed in order to adapt the performance of the garbage collector to the performance characteristics of the hardware platform. Therefore, what is needed is a garbage collection process having guaranteed space bounds that can be easily be tuned for a variety of particular applications.